Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

99
Vistas
possible unhandled promise rejection: "Unable to find any RSS element in feed

i found this error in other places but not with RSS feed.. so anyway, i'm trying to create a news app with react native using RSS feeds.. i got this one from "huffpost", was mainly logging on the browser (since it's the easier for me to use), i did fetch the data from the RSS feed, parsed it:

const getNews = async () => {
   fetch('https://peaceful-peak-58941.herokuapp.com/https://www.huffpost.com/section/front-page/feed?x=1')
  .then((response) => response.text())
  .then((responseData) => rssParser.parse(responseData))
  .then((rss) => {
    setArticles(rss.items)
  });
}

when i logged it i noticed that it logs twice, once when the state is still empty (still didn't get any feed yet), then the 2nd time is when i get the feed nd the data i need, i was like thats fine since it happened to me before in reactJs but it was "fine" at the time, now i was like okay let me try this on a mobile emulator.. but then instead of it just doing the same thing as in the browser, it just keeps giving me the error "possible unhandled promise rejection: "Unable to find any RSS element in feed" ", why doesn't it display the data since eventually it should get the data? (i tried again on the browser nd it seems to work) (using expo if it matters)

{articles.length > 0 ? articles.map(article=>(
       <View key={article.id} style={{width:"100%"}}>
           <Text style={styles.title}>{article.title}</Text>
           <Image  style={{width:'100%', height:"300px"}}
             source={{uri:`${article.enclosures[0].url}`}}/>
           <Text style={styles.description}>{article.description}</Text>
           
           </View>
     )) : <Text>...</Text>}
about 4 years ago · Santiago Gelvez
1 Respuestas
Responde la pregunta

0

Fetch will recieve OPTIONS first and send the actual data right after that. You can configure it so you can fetch without the annoying OPTIONS. Just add another parameter {method: 'get'}, in the fetch function

const getNews = async () => {
       fetch('https://peaceful-peak-58941.herokuapp.com/https://www.huffpost.com/section/front-page/feed?x=1', {method:'get'})
      .then((response) => response.text())
      .then((responseData) => rssParser.parse(responseData))
      .then((rss) => {
        setArticles(rss.items)
      });
    }
about 4 years ago · Santiago Gelvez Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda